package com.daguchuangyi.erp_android.manager.networkservice;

import com.daguchuangyi.erp_android.manager.networkservice.model.ParamRequestModel;
import com.daguchuangyi.erp_android.model.ParameterWrapper;
import com.daguchuangyi.erp_android.model.category.CategoryWrapper;
import com.daguchuangyi.erp_android.model.product.DetailImageModel;
import com.daguchuangyi.erp_android.model.product.Product;
import com.daguchuangyi.erp_android.model.product.ProductListWrapper;
import com.daguchuangyi.erp_android.model.product.ProductWrapper;
import com.daguchuangyi.erp_android.model.product.SimalarProductResult;
import com.daguchuangyi.erp_android.model.product.satification.ClientIdWrapper;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by lijianjian on 2018/3/17.
 */

public interface ProductService {

    @GET("/category")
    Observable<CategoryWrapper> getCategory();

    @POST("/product")
    Observable<ProductListWrapper> listProductInfo(@QueryMap Map<String, Object> queryMap, @Body Map<String, Object> bodyMap);

    @GET("/parameter/all")
    Observable<ParameterWrapper> listParameterSetting();

    @GET("/product/{id}")
    Observable<ProductWrapper> getProductDetailInfo(@Path("id") String id);

    @POST("/product")
    Observable<ProductListWrapper> listProductInfo(@QueryMap Map<String, Object> queryMap, @Body ParamRequestModel paramRequestModel);

    @Multipart
    @POST("/product/image/recognition")
    Observable<SimalarProductResult> recognizeImage(@Part MultipartBody.Part file,
                                                  @Part("cropData") RequestBody description,
                                                  @QueryMap Map<String, Object> queryMap);

    @GET("/product/detail")
    Observable<ProductWrapper> getProductDetailByPNO(@QueryMap Map<String, Object> queryMap);

    @GET("/product/{id}/detailImage")
    Observable<DetailImageModel> getProductDetailImage(@Path("id") String id);

    @POST("/product/image/findById")
    Observable<SimalarProductResult> findSimalarProductList(@QueryMap Map<String, Object> queryMap);

    @GET("/clientId")
    Observable<ClientIdWrapper> getClientId();

    @GET("/product/image/relation")
    Observable<Map<String, String>> sendSatificationFeedback(@QueryMap Map<String, Object> queryMap);


    @POST("/setting/parameter")
    Observable<Map<String, Object>> updateParameters(@Body Map<String, Object> parameters);


}
